﻿/*********************************************************************
 * @file   FITKAbstractRecogClosedSpace.h
 * @brief  封闭空间识别基类
 * @author zhangjingxuan (hiter25@outlook.com)
 * @date   2024-10-30
 *********************************************************************/
#ifndef __FITKABSTRACTRECOGCLOSEDSPACE_H__
#define __FITKABSTRACTRECOGCLOSEDSPACE_H__
#include "FITK2DMeshToolsAPI.h"
#include <QList>

namespace Core
{
    class FITKNode;
    class FITKPoint;
}

namespace Interface
{
    class FITKElementTri3;
}

namespace Interface
{
    /**
     * @brief  封闭空间识别基类
     * @author zhangjingxuan (hiter25@outlook.com)
     * @date   2024-11-04
     */
    class FITK2DMeshToolsAPI FITKAbstractRecogClosedSpace
    {
    public:
        FITKAbstractRecogClosedSpace(FITKAbstractRecogClosedSpace&) = delete;
        virtual ~FITKAbstractRecogClosedSpace() = 0;
        /**
         * @brief    创建封闭空间识别类对象
         * @return   FITKRecogClosedSpace *封闭空间识别类对象
         * @author   zhangjingxuan (hiter25@outlook.com)
         * @date     2024-10-31
         */
        static FITKAbstractRecogClosedSpace* createFITKRecogClosedSpace();
        /**
        * @brief    初始化网格模型
        * @param[i] meshPoints 点数据
        * @param[i] meshFaces  面数据
        * @return   bool  true,初始化成功,false,初始化失败
        * @author   zhangjingxuan (hiter25@outlook.com)
        * @date     2024-10-31
        */
        virtual bool initMesh(const QList<Core::FITKNode*>& meshPoints, const QList<Interface::FITKElementTri3*>& meshFaces) = 0;
        /**
        * @brief    网格预处理，筛选出单边面
        * @return   std::vector<int> 存储单边面的容器
        * @author   zhangjingxuan (hiter25@outlook.com)
        * @date     2024-10-31
        */
        virtual QList<int> meshPreProcess() = 0;
        /**
        * @brief    封闭空间识别流程
        * @return   void
        * @author   zhangjingxuan (hiter25@outlook.com)
        * @date     2024-10-30
        */
        virtual void recogClosedSpace(bool is_del = true) = 0;
        /**
        * @brief    输出封闭空间面的id
        * @return   std::vector<std::vector<int>> 存储封闭空间及面索引的容器
        * @author   zhangjingxuan (hiter25@outlook.com)
        * @date     2024-10-30
        */
        virtual QList<QList<int>> getFacesIndex() = 0;
        /**
         * @brief    获取自由边
         * @return   std::vector<std::pair<int,int>> 存储边顶点索引的容器
         * @author   zhangjingxuan (hiter25@outlook.com)
         * @date     2024-11-01
         */
        virtual QList<QPair<int, int>> getBoundary() = 0;
        /**
         * @brief    获取每个封闭空间体积
         * @return   QList<double>
         * @author   zhangjingxuan(hiter25@outlook.com)
         * @date     2025-01-16
         */
        virtual QList<double> getSpaceVolume() = 0;
    protected:
        FITKAbstractRecogClosedSpace() = default;
    };
}
#endif //! __FITKABSTRACTRECOGCLOSEDSPACE_H__